import request from './request';
// 登录请求api
export const LoginApi = (params: ILoginParams): IR<string> =>
  request.post('/1024/login', params);
// 后台内部帮我们封装过返回结果，导致请求的返回结果是Promise<AxiosResponse>,导致我们调用请求接口的时候，.then的回调函数的类型是AxiosResponse
// 这个返回结果不是想要的数据结构，所以需要修改返回结果
// 首页请求api
export const HomeApi = (): IR<IHomeData> => request.get('/6666');
// 注册api
export const RegisterApi = (params: RegisterParams): IR<string> =>
  request.post('/1024/register', params);
// 快速刷题api
export const FastApi = (): IR<IFastData> => request.get('/4698');
// 练习api
export const PracticeApi = (params: IPracticeUrl): IR<ISelectOption[]> =>
  request.get(`/1314/${params.actionCode}/${params.testType}`);
// 获取设置默认学科数据api
export const DefaultSubApi = (params: ISubject): IR<Array<IHomeDataCon>> =>
  request.get(`/6666/${params.actionCode}`);
// 设置默认学科api
export const DefaultSubjApi = (params: ISubject): IR<Array<IHomeDataCon>> =>
  request.post(`/6666/${params.actionCode}`);
// 侧边栏切换学科
export const FieldApi = (): IR<Array<IHomeDataCon>> =>
  request.get('/6666/field');
// 提交答题内容api
export const SubmitPracticeApi = (params: IDataParams): IR<ISubmitPractice[]> =>
  request.post('/1314', params);
// 提交答案api
// export const SubmitApi = (params: ISubmit): IR<string> =>
//   request.put('/1314', params);
